package com.candy.service.impl;

import com.candy.dao.AccountDao;
import com.candy.dao.impl.AccountDaoImpl;
import com.candy.service.AccountService;

import java.util.Date;

public class AccountServiceImpl implements AccountService {
    AccountDao accountDao=new AccountDaoImpl();
    private String name;
    private Integer age;
    private Date birthday;

    public AccountServiceImpl() {
        System.out.println("创建对象");
    }

    public AccountServiceImpl(String name, Integer age, Date birthday) {
        this.name = name;
        this.age = age;
        this.birthday = birthday;
    }

    @Override
    public void saveAccount() {
//        accountDao.saveAccont();
        System.out.println("name:"+name+";age:"+age+":birthday:"+birthday);
    }


    public void initMethod(){
        System.out.println("我是初始化方法");
    }

    public  void  destroyMethod(){
        System.out.println("我是对象销毁前调用的方法");
    }

    public AccountDao getAccountDao() {
        return accountDao;
    }

    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
}
